package logic

import (
	"personnel-management/dao/mysql"
	"personnel-management/models"
)

func GetUserList() ([]*models.User, error) {
	//查数据库  查找到所有的username 并返回
	return mysql.GetUserList()
}

func GetUserMessage(userName string) (*models.User, error) {
	//查数据库  查找到当前用户username 并返回
	return mysql.GetUserMessage(userName)
}

func UpdateUserDetail(userid int64, userName string, user *models.User) error {
	return mysql.UpdateUserDetailByName(userid, userName, user)
}

func DeleteUserDetail(userid int64) error {
	return mysql.DeleteUserDetailByID(userid)
}
